#include <iostream>
#include <unistd.h>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <jsoncpp/json/json.h>
#include <map>
using namespace std;

enum OP_TYPE{DL = 1,ZC,CK,YD,CKYY,QX,TC};//登陆 注册 查看 预订 查看预约 取消预约 退出

class Client
{
private:
    int sockfd;
    short m_port;
    string m_ips;

    bool Dl_flg;
    int User_op;
    string user_name;
    string user_tel;

    bool running;
    map<int,string> m_map;
    map<int,string> yd_map;

    void Print_info();
    void ZC_User();
    void DL_User();
    void CK_Ticket();
    void YD_Ticket();
    void CK_YY();
    void QX_YY();
    void TC_User();

public:
    Client(string ips,short port):m_ips(ips),m_port(port)
    {
        sockfd = -1;
        Dl_flg = false;
        User_op = 0;
        running = true;
    }
    Client()
    {
        m_ips = "127.0.0.1";
        m_port = 6000;
        sockfd = -1;
        Dl_flg = false;
        User_op = 0;
        running = true;
    }

    bool Connect_toServer();

    void Run();
};